Skip to content

Limit Order fixes#22

Open
dkuthoore wants to merge 199 commits intooyaprotocol:mainfrom
dkuthoore:dk/limitOrder-fixes
Open

Limit Order fixes#22
dkuthoore wants to merge 199 commits intooyaprotocol:mainfrom
dkuthoore:dk/limitOrder-fixes

Conversation

@dkuthoore
Copy link
Copy Markdown
Contributor

Summary

This PR addresses the remaining review comments from #20:
(1) enforce the price limit predicate in validateToolCalls before approving swaps;
(2) enforce the SMA predicate in the SMA variant;
(3) set the hydration lock only after a successful ProposalExecuted log fetch so failed fetches are retried. It also adds a validity guard for SMA and price data in the limit-order-sma agent.

Changes

1. Enforce limit predicate (limit-order)

  • agent-library/agents/limit-order/agent.js: Added LIMIT_PRICE_USD = 2000 and a price check in validateToolCalls before validated.push. Fetches ethPriceUSD via Chainlink (with CoinGecko fallback) and throws if ethPriceUSD > LIMIT_PRICE_USD.

2. Enforce SMA predicate (limit-order-sma)

  • agent-library/agents/limit-order-sma/agent.js: In validateToolCalls, before validated.push, fetches ethPriceUSD and smaEth200USD from fetchEthPriceDataFromCoinGecko() and throws if ethPriceUSD > smaEth200USD. Adds a validity guard that throws if smaEth200USD or ethPriceUSD is null, undefined, or not finite before the comparison.

3. Defer hydration lock until log fetch succeeds

  • agent-library/agents/limit-order/agent.js and agent-library/agents/limit-order-sma/agent.js: In reconcileProposalSubmission, moved hydratedFromChain = true from before the getLogs call to after it (inside the try block). If getLogs throws, hydration is not marked complete and the next poll retries.

pemulis and others added 30 commits January 14, 2026 10:44
…pp-with-wallet-connection

Add Vite + React frontend for Safe + Optimistic Governor deployment
…-config-module

Add frontend ABIs and Safe/OG default config with identifier encoding
…section-to-readme.md

Add Web Frontend documentation to README
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Bumps [h3](https://github.com/h3js/h3) from 1.15.4 to 1.15.5.
- [Release notes](https://github.com/h3js/h3/releases)
- [Changelog](https://github.com/h3js/h3/blob/v1.15.5/CHANGELOG.md)
- [Commits](h3js/h3@v1.15.4...v1.15.5)

---
updated-dependencies:
- dependency-name: h3
  dependency-version: 1.15.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [hono](https://github.com/honojs/hono) from 4.11.4 to 4.11.7.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](honojs/hono@v4.11.4...v4.11.7)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.11.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
…/frontend/h3-1.15.5

Bump h3 from 1.15.4 to 1.15.5 in /frontend
…/frontend/lodash-4.17.23

Bump lodash from 4.17.21 to 4.17.23 in /frontend
…/frontend/hono-4.11.7

Bump hono from 4.11.4 to 4.11.7 in /frontend
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Clarify the role of agents in the commitment process.
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
pemulis and others added 29 commits February 13, 2026 11:51
… BUY trade instead of first activity event

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
…posalHash output backward compatible

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
… is closed out

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
…nctions instead of reimplementing

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
…ansactions

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
…re implementation

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
…if using relayer

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
…layer mode

Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
Signed-off-by: John Shutt <pemulis@users.noreply.github.com>
copy trading agent and various polymarket improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants